<?php
session_start();
include_once 'recursos/config.php';
$conf = new configuracion();
$dominio = $conf->getG2uDominio()."/";
$_SESSION["g2uActualPhotoComment"] = "";
if (is_array($_SESSION["g2uNewsList"]) && count($_SESSION["g2uNewsList"]) > 0 ){
    foreach ($_SESSION["g2uNewsList"] as $key => $value) {

        $_SESSION["g2uActualPhotoComment"] = $_SESSION["g2uDataPhotoComment"][$key];

        
    ?>
    <div id="news_<?=$key?>"> 
        <table width="100%">
            <tr>
                <td rowspan="3" style="vertical-align: top; width: 65px;">
                    <img class="profile-img" src="<?=$dominio.$value["upic"]?>" />
                </td>
                <td>
                    <font style="color: #3366ff;" >
                        <a href="/@/<?=$value["user_sys_name"];?>"><?=$value["usuario"]?></a>
                    </font>
                    <br/>
                    <font style="font-size: 10pt;" >
                        <?=$value["desc"]?>
                    </font>
                    <? if(isset($_SESSION["g2uNewsWishList"][$key]["img"])){ ?>
                        <br/>
                        <img class="img" 
                             src="<?=$dominio.$_SESSION["g2uNewsWishList"][$key]["img"]?>" 
                             rel="<?=$_SESSION["g2uNewsWishList"][$key]["idPost"]?>" 
                             id="<?=$_SESSION["g2uNewsWishList"][$key]["imgName"]?>"
                             user="<?=$value["id"]?>"
                             />
                    <? } ?>
                    <br/>
                    <span id="l_cont_<?=$key?>" rel="<?=$key?>" onclick="submitLikeNews('<?=$_SESSION["g2uNewsWishList"][$key]["idPost"]?>', '<?=$key?>')" ><img src="<?=$dominio?>images/png/estrella.png" /><?=$value["l_count"]?></span>
                    <span id="c_cont_<?=$key?>" rel="<?=$key?>"><img src="<?=$dominio?>images/png/comentario.png" /><?=$value["c_count"]?></span>
                    
                    <div class="comments_news" id="comments_<?=$key?>" style="border-color: lightgrey; border-style: solid; border-width: 0.1em"> 
                        <input type="hidden" name="img" value="<?=$_REQUEST["id"]?>" id="img" />
                            <table> 
                                <tr>
                                   <td class="field">
                                       <input type="text" name="text_<?=$key?>" id="text_<?=$key?>" />
                                   </td>
                                   <td class="field">
                                       <input type="button" onclick="submitCommentNews('<?=$_SESSION["g2uNewsWishList"][$key]["idPost"]?>','<?=$_SESSION["g2uNewsWishList"][$key]["imgName"]?>', '<?=$key?>');" value="Comentar!" />
                                   </td>
                               </tr>
                            </table> 
                        <div id="comments_list_<?=$key?>" class="comments_list">
                            <?php
                            include 'vista/vista.wishlist_photo_comments.php';
                            ?>
                        </div> 
                    </div>
                    
                </td>
            </tr>
        </table>
    </div>
<hr style="border-width: 0.1em;" />
    <?        
    }
} else {
    echo "Aun no hay actividad...";
}
?>
<script lang="javascript" type="text/javascript" src="<?=$dominio?>js/gallery.js"></script>
